<!DOCTYPE html>
<html>

<head>
    {include file="Public/header"}
    <link href="__STATIC__/layout/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
       <link rel="stylesheet" href="__STATIC__/layout/css/demo.css" type="text/css">
    <link href="__STATIC__/layout/css/gyq.css" rel="stylesheet">
    <style>
        body {
            font-size: 14px
        }

        .row {
          
            margin: 0 auto;
        }

        .colorRed {
            color: red;
        }

        .trBackgroundColor {
            background: #c5e1fe
        }

        .mlR {
            margin: 0 5px;
        }
    </style>
</head>

<body class="white-bg" style="color:#333;padding:3px;" class="x_sorll">
    <div class="page-heade">
       <h2 class="title_color text-center">待审批系统</h2>
    </div>
    <form action="" class="form-inline" method="get" id="form1">
        <table class="table table-bordered">
            <tr>
                <td><label for="zone">分区：</label><input id="zone" type="text" class="form-control textW" name="zone" value="{$zone}"></td>
                <td><label for="zoning_head">分区负责人：</label><input id="zoning_head" type="text" class="form-control textW" name="zoning_head" value="{$zoning_head}"></td>
                <td><label for="jxs_sn">经销商编号：</label><input id="jxs_sn" type="text" class="form-control textW" name="jxs_sn" value="{$jxs_sn}"></td>
                <td><label for="jxs_title">经销商名称：</label><input id="jxs_title" type="text" class="form-control textW" name="jxs_title" value="{$jxs_title}"></td>
            </tr>
            <tr>
                <td><label for="provice">省份：</label><input type="text" class="form-control textW" id="provice" name="provice" value="{$provice}"></td>
                <td><label for="proFuzeMan">省份负责人：</label><input id="proFuzeMan" type="text" class="form-control textW"
                                                                 name="provice_head" value="{$provice_head}"></td>
                <td><label for="systemName">系统名称：</label><input id="systemName" type="text" class="form-control textW"
                                                                name="systemName" value="{$systemName}"></td>
                <td><label for="systemNo">系统编号：</label><input id="systemNo" type="text" class="form-control textW" name="systemNo" value="{$systemNo}">
                </td>
            </tr>
            <tr>
                <td><label for="city">城市：</label><input id="city" type="text" class="form-control textW" name="city" value="{$city}"></td>
                <td><label for="cityFuzeMan">城市负责人：</label><input id="cityFuzeMan" type="text" class="form-control textW"
                                                                  name="city_head" value="{$city_head}"></td>
                <td><label for="servicer">业务人员：</label><input id="servicer" type="text" class="form-control textW" name="stuff" value="{$stuff}">
                </td>
                <td><label for="salesMan">业务代表：</label><input id="salesMan" type="text" class="form-control textW" name="salesMan">
                </td>
            </tr>
            <tr>
                <td style="border-bottom:0" colspan="4"><label for="spStatus">审批状态：</label>

                    <select id="spStatus" name="appType" class="form-control select">
                        <option value="quanbu">全部</option>
                        <option value="0" {if $appType==0}selected{/if} >审批中</option>
                        <option value="-1" {if $appType==-1}selected{/if} >已退回</option>
                        <option value="2" {if $appType==2}selected{/if} >已否决</option>
                        <option value="1" {if $appType==1}selected{/if} >通过</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td colspan="4" style="text-align: center;">
                    <button class="btn btn-primary query">查询</button>
                    <button class="btn  btn-primary emptyIf" id="reset">清空查询条件</button>
                </td>
            </tr>
            <tr>
                <td colspan="4">
                    <button class="btn btn-primary allApraval">批量审批</button>
                    <span class="glyphicon glyphicon-bell" aria-hidden="true"
                          style="color:red;font-size: 20px;margin:0 10px 0 100px"></span><span class="colorRed">如下待审批系统未设置提醒人</span>
                    <button class="btn btn-primary setRemindPeople">设置提醒人</button>
                </td>
            </tr>
        </table>
    </form>
    <!-- 表格 -->
    <div class="padding-10">
        <table class="table table-striped table-bordered table-hover bud_hei text-center" style="width: 100%;" id="editable">
            <thead>
            <tr class="info">
                <th class="text-center" style="vertical-align: middle !important;text-align: center;"> 选择<input type="checkbox"  id="checkAll"></th>
                <th class="text-center">No</th>
                <th class="text-center">系统编号</th>
                <th class="text-center">系统名称</th>
                <th class="text-center">销售分区</th>
                <th class="text-center">省份</th>
                <th class="text-center">城市</th>
                <th class="text-center">所属经销商编号</th>
                <th class="text-center">所属经销商名称</th>
                <th class="text-center">申请人</th>
                <th class="text-center">申请时间</th>
                <th class="text-center">申请类型</th>
                <th class="text-center">审批状态</th>
                <th class="text-center">维护</th>
            </tr>
        </thead>
            <tbody style="border: 0">
            <form action="#" method="get" id="form_approvalSystem">
                {volist name="data" id="row"}
                <tr>
                    <td align="center"><input type="checkbox" name="items"></td>
                    <td>1</td>
                    <td>
                        {$row.sn}
                    </td>
                    <td><a href="javascript:;" class="showDetail">{$row.title}</a></td>
                    <td>{$row.zoning_title}</td>
                    <td>{$row.provice_title}</td>
                    <td>{$row.city_title}</td>
                    <td>{$row.jxs_sn}</td>
                    <td><a href="javascript:;" class="showAgencyDetail">{$row.jxs_title}</a></td>
                    <td><a href="javascript:;">{$row.cusername}</a></td>
                    <td>{$row.ctime}</td>
                    <td>添加系统</td>
                    <td>{$row.appType==0?'审批中':$row.appType==-1?'已退回':$row.appType==2?'已否决':'通过'}</td>
                    <td>
                        <a href="javascript:;" class="showDetail" data-link="{:url('viewDetail',['id'=>$row.id,'system_id'=>$row.system_id])}">明细</a>
                        <a href="javascript:;" class="mlR" data-link="{:url('view',['id'=>$row.id,'system_id'=>$row.system_id])}">审批</a>
                        <a href="javascript:;">辅助依据</a>
                    </td>
                </tr>
                {/volist}
            </form>
            </tbody>
        </table>
       <div class="row text-center" id="pageText" style="padding: 0;margin: 0;">
			<div class="col-sm-6 text-left"><div class="padding-10 countSize">共{$count}条记录，{$maxpage}页&nbsp;&nbsp;</div></div>
			<div class="col-sm-6 text-right">{$page}</div>
	</div>

    </div>
</div>
<!-- 弹出框 -->

<!-- 表格 -->


<!-- 全局js -->
{include file="Public/footer"}
<!-- <script src="js/plugins/metisMenu/jquery.metisMenu.js"></script> -->
<script src="__STATIC__/layout/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<script src="__STATIC__/layout/js/plugins/layer/layer.min.js"></script>

<!-- 自定义js -->
<!-- <script src="js/hplus.js?v=4.1.0"></script> -->
<!-- <script type="text/javascript" src="js/contabs.js"></script> -->
<!-- Peity -->


<script src="__STATIC__/layout/js/plugins/sweetalert/sweetalert.min.js"></script>
<!-- <script type="text/javascript" src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script> -->
<!--统计代码，可删除-->
<script>
    /*操作表格复选框*/
    $(document).ready(function () {
        /*设置提醒人*/
        $(".setRemindPeople").click(function () {
            layer.open({
                type: 2,
                title: '&nbsp;',
                shadeClose: true,
                shade: false,
                maxmin: true, //开启最大化最小化按钮
                area: ['800px', '600px'],
                content: '{:url("syspenwarn/add")}'
            })
            return false
        });
        //清除查询条件
        $('#reset').on('click',function () {
            $("#form1 input").each(function(){
                $(this).val('');
            });
            $("#form1 select").each(function(){
                $(this).val('');
            });
            $('#form1').submit()
            return false
        })
        $("#checkAll").click(function () {

            $("[name=items]:checkbox").prop("checked", $(this).prop("checked"));
            if ($("[name=items]:checkbox").prop("checked") != true) {
                // console.log($(this))
                $("[name=items]:checkbox").parents("tr").css("backgroundColor", "#fff")
            } else {
                $("[name=items]:checkbox").parents("tr").css("backgroundColor", "#f8f800")

            }
        })
        $("[name=items]:checkbox").click(function () {
            //定义一个临时变量，避免重复使用同一个选择器选择页面中的元素，提高程序效率
            // console.log(1)
            var $tmp = $("[name=items]:checkbox");
            if ($(this).prop("checked") != true) {
                // console.log($(this))
                $(this).parent().parent().css("backgroundColor", "#fff")
            } else {
                $(this).parent().parent().css("backgroundColor", "#f8f800")

            }
            //用filter()方法筛选出选中的复选框，并直接给CheckedAll赋值
            $("#checkAll").prop('checked', $tmp.length == $tmp.filter(':checked').length);

        });
        /*批量审批*/
        $(".allApraval").click(function () {
            var $items = $("[name=items]:checkbox")

            if ($items.filter(':checked').length < 1) {
                sweetAlert("", "请选择要审批的系统！", "error");
            } else {
                // $("#alert_addNewZone").show();
                // 要审批的内容
            }
            return false
        })
        /*显示明细*/
        $(".showDetail").click(function () {
            var link = $(this).data('link')
            layer.open({
                type: 2,
                title: '待审批系统明细',
                shadeClose: true,
                shade: false,
                maxmin: true, //开启最大化最小化按钮
                area: ['800px', '500px'],
                content: link
            })
        });

        //审核
        $(".mlR").click(function () {
            var link = $(this).data('link')
            layer.open({
                type: 2,
                title: '审核',
                shadeClose: true,
                shade: false,
                maxmin: true, //开启最大化最小化按钮
                area: ['800px', '500px'],
                content: link
            })
        });

        /*显示经销商详情*/
        $(".showAgencyDetail").click(function () {
            layer.open({
                type: 2,
                title: '&nbsp;',
                shadeClose: true,
                shade: false,
                maxmin: true, //开启最大化最小化按钮
                area: ['1000px', '600px'],
                content: 'http://localhost/xiaolutong/xiaolutong/AgencyDetail.html'
            })
        });
    });
</script>
</body>

</html>